/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.modudf;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;

public class ProcessCMD implements Runnable {
    private final InputStream is;
    private final OutputStream os;

    public ProcessCMD(InputStream is, OutputStream os) {
        this.is = is;
        this.os = os;
    }

    public void run() {
        final byte[] buffer = new byte[4096];
        try {
            int bytesRead;
            while ((bytesRead = is.read(buffer)) != -1) {
                os.write(buffer, 0, bytesRead);
            }
            os.flush();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
}
